-- ----------------------------- 2023-07-06 add by zhoujq--------------begin

-- 建表语句
CREATE TABLE T_LIMS_PRODUCT_MAIN_PUPOSE( 
    ID NUMBER NOT NULL,
    PRODUCTMAINID NUMBER NULL,
    PRODUCTCODE VARCHAR2(100)  NULL,
    PURPOSEID NUMBER NULL,
    DEFAULTRESULT VARCHAR2(100)  NULL,
    RESULTTYPE VARCHAR2(100)  NULL,
    UNIT VARCHAR2(100)  NULL,
    FORMULA VARCHAR2(500)  NULL,
    ROUNDINGRULE VARCHAR2(200)  NULL,
    SORTER NUMBER NULL,
    CREATEDBYID VARCHAR2(36)  NULL,
    CREATEDBYNAME VARCHAR2(60)  NULL,
    CREATEDTIME DATE NULL,
    CREATEDBYORGID VARCHAR2(36)  NULL,
    CREATEDBYORGNAME VARCHAR2(270)  NULL
 );
COMMENT ON TABLE T_LIMS_PRODUCT_MAIN_PUPOSE IS '检测项目目的';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.ID IS '主键';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.PRODUCTMAINID IS '检测项目id';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.PRODUCTCODE IS '检测项目编号';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.PURPOSEID IS '检测目的id';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.DEFAULTRESULT IS '默认结果';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.RESULTTYPE IS '结果类型';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.UNIT IS '单位';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.FORMULA IS '公式';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.ROUNDINGRULE IS '修约';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.SORTER IS '排序码';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDBYID IS '制单人编码';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDBYNAME IS '制单人名称';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDTIME IS '制单时间';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDBYORGID IS '制单人单位编码';
COMMENT ON COLUMN T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDBYORGNAME IS '制单人单位名称';

ALTER TABLE T_LIMS_PRODUCT_MAIN_PUPOSE ADD CONSTRAINT PK_LIMS_PRODUCT_MAIN_PUPOSE PRIMARY KEY (ID);

-- 旧版审计跟踪，跟踪配置变更语句

INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','ID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','PRODUCTMAINID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','PRODUCTCODE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','PURPOSEID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','DEFAULTRESULT','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','RESULTTYPE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','UNIT','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','FORMULA','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','ROUNDINGRULE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','SORTER','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDBYID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDBYNAME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDTIME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDBYORGID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDBYORGNAME','1',CURRENT_TIMESTAMP);
COMMIT;

-- 审计跟踪V2，跟踪配置变更语句

INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','ID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','PRODUCTMAINID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','PRODUCTCODE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','PURPOSEID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','DEFAULTRESULT','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','RESULTTYPE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','UNIT','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','FORMULA','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','ROUNDINGRULE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','SORTER','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDBYID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDBYNAME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDTIME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDBYORGID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PRODUCT_MAIN_PUPOSE','CREATEDBYORGNAME','1');
COMMIT;
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.SERVICE_NAME', '检测项目目的', '检测项目目的', 'zh-CN', '检测项目目的');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.ID', '检测项目目的的主键', '主键', 'zh-CN', '主键');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.PRODUCTMAINID', '检测项目目的的检测项目id', '检测项目id', 'zh-CN', '检测项目id');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.PRODUCTCODE', '检测项目目的的检测项目编号', '检测项目编号', 'zh-CN', '检测项目编号');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.PURPOSEID', '检测项目目的的检测目的id', '检测目的id', 'zh-CN', '检测目的id');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.DEFAULTRESULT', '检测项目目的的默认结果', '默认结果', 'zh-CN', '默认结果');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.RESULTTYPE', '检测项目目的的结果类型', '结果类型', 'zh-CN', '结果类型');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.UNIT', '检测项目目的的单位', '单位', 'zh-CN', '单位');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.FORMULA', '检测项目目的的公式', '公式', 'zh-CN', '公式');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.ROUNDINGRULE', '检测项目目的的修约', '修约', 'zh-CN', '修约');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.SORTER', '检测项目目的的排序码', '排序码', 'zh-CN', '排序码');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDBYID', '检测项目目的的制单人编码', '制单人编码', 'zh-CN', '制单人编码');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDBYNAME', '检测项目目的的制单人名称', '制单人名称', 'zh-CN', '制单人名称');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDTIME', '检测项目目的的制单时间', '制单时间', 'zh-CN', '制单时间');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDBYORGID', '检测项目目的的制单人单位编码', '制单人单位编码', 'zh-CN', '制单人单位编码');
CALL INSERTI18N('T_LIMS_PRODUCT_MAIN_PUPOSE.CREATEDBYORGNAME', '检测项目目的的制单人单位名称', '制单人单位名称', 'zh-CN', '制单人单位名称');
CALL INSERTI18N('BASEMODULE.COREDATA.PRODUCTS.MODAL.ADD', '新增', '新增', 'zh-CN', '新增');
CALL INSERTI18N('BASEMODULE.COREDATA.PRODUCTS.TAB.BASE_INFO', '基本信息', '基本信息', 'zh-CN', '基本信息');
CALL INSERTI18N('BASEMODULE.COREDATA.PRODUCTS.BUTTON.BUTTON', '按钮', '按钮', 'zh-CN', '按钮');
CALL INSERTI18N('BASEMODULE.COREDATA.PRODUCTS.TIP.TIP', '提示框', '提示框', 'zh-CN', '提示框');
CALL INSERTI18N('BASEMODULE.COREDATA.PRODUCTS.MODAL.MODAL', '对话框', '对话框', 'zh-CN', '对话框');

-- 创建菜单语句
INSERT INTO T_CORE_MENU (ID, MENUNAME, HREF, PARENTID, ORDERNO, ICON, MENUINITNAME)
VALUES ('2023070601', '普检检测项目目的', '/secure/basemodule/coredata/product-main-puposes/page/edit-list', 'null', '2023070601', 'null', '普检检测项目目的');

INSERT INTO T_CORE_TABLE (ID, AUDITABLE, ATTACHMENT)
VALUES ('T_LIMS_PRODUCT_MAIN_PUPOSE', '0', '0');


COMMIT;

-- ----------------------------- 2023-07-06 add by zhoujq------------end